﻿# Root = Country
on_monthly_pulse_country = {
	events = {
		character_roles_hidden.1
		character_roles_hidden.2
		character_roles_hidden.3
		character_roles_hidden.4
		character_roles_hidden.5
		character_roles_hidden.6
		communism.8 # Red Army
		peoples_springtime.1
		low_countries_events.3
		low_countries_events.4
		opium_wars.1
		native_resettlement.1
		meiji.13
		bic_breakup.1
		treaty_of_villafranca.1
		italy_1848.1
		italy_1848.3
		italy_1848.6
		italy_1848.7
		italy_1848.18
		italy_1848.19
		italy_1848.20
		italy_1848.22
		italy_1848.23
		italy_1848.24
		italy_1848.27
		italy_1848.30
		italy_1848.31
		italy_1848.32
		italy_1848.35
		italy_flavor.1
		italy_flavor.2
		exp_thousand.7
		exp_thousand.8
		exp_thousand.103
		exp_thousand.107
		exp_thousand.108
		france_event.2
		france_event.6
		france_event.7
		france_event.8
		france_event.9
		france_event.13
		france_event.16
		france_event.17
		flavor_usa_events.1
	}
	# Election Events
	random_events = {
		50 = 0
		1 = election_liberal_events.1
		1 = election_liberal_events.2
		1 = election_liberal_events.3
		1 = election_liberal_events.4
		1 = election_conservative_events.1
		1 = election_conservative_events.2
		1 = election_conservative_events.3
		1 = election_conservative_events.4
		1 = election_moderate_events.1
		1 = election_moderate_events.2
		1 = election_contextual_events.1
		1 = election_contextual_events.2
		1 = election_contextual_events.3
		1 = election_contextual_events.4
		1 = election_contextual_events.5
		1 = election_contextual_events.6
		1 = election_contextual_events.7
		1 = election_contextual_events.8
		1 = election_neutral.1
		1 = election_neutral.2
		1 = election_neutral.3
		1 = election_neutral.4
		1 = election_neutral.5
		1 = election_neutral.6
		1 = election_neutral.7
		1 = election_neutral.8
		1 = election_other_parties_events.1
		1 = election_other_parties_events.2
		1 = election_other_parties_events.3
		1 = election_other_parties_events.4
		1 = election_other_parties_events.5
		1 = ig_leaders.3
	}
	random_events = {
		5 = france_event.1
		7 = france_event.14
	}
	effect = {
		if = {
			limit = {
				THIS = c:FRA
				c:FRA ?= {
					has_modifier = modifier_haitian_independence_payments
				}
				NOT = { exists = c:HAI }
			}
			c:FRA = { remove_modifier = modifier_haitian_independence_payments }
		}
	}
}

on_weekly_pulse = {
	events = {
		exp_thousand.103
		exp_thousand.107
	}
	effect = {
	}
}

# Root = Colony state
on_colony_created = {
	effect = {
		owner = {
			save_scope_as = colony_founder
		}
		owner = {
			if = {
				limit = {
					has_journal_entry = je_tutorial_colonize_state
				}
				root = {
					set_variable = {
						name = tut_colony_target
					}
				}
			}
		}
		owner = {
			if = {
				limit = {
					owner = c:RUS
					OR = {
						c:RUS = {
							has_state_in_state_region = STATE_SAKHALIN 
						}
						c:RUS = {
							has_state_in_state_region = STATE_HOKKAIDO 
						}
					}
					NOT = {
						has_global_variable = japanese_response
					}
				}
				set_global_variable = japanese_response
				c:JAP = {
					create_diplomatic_play = {
						name = testname
						war = yes
						type = dp_annex_war
						
						target_state = s:STATE_HOKKAIDO.region_state:AIN
					}
				}
			}
		}
		if = {
			limit = {
				owner = { has_law = law_type:law_frontier_colonialism }
				NOT = {
					any_neighbouring_state = {
						OR = {
							is_incorporated = yes
							any_neighbouring_state = {
								is_incorporated = yes
								owner = scope:colony_founder
							}
						}
						owner = scope:colony_founder
					}
					#has_modifier = frontier_colonialism_modifier
				}
			}
			add_modifier = frontier_colonialism_modifier
		}
		#temporary solution giving barracks to colonies to prevent being overrun
		if = {
			limit = {
				owner = {
					country_is_in_africa = no
					is_ai = yes
				}
				is_under_colonization = yes
				is_incorporated = no
				OR = {
					state_in_africa = yes
				}
				NOT = {
					has_building = building_barracks
				}
			}
			create_building = {
				building = building_barracks
				level = 1
			}
		}
	}
}

# Root = country
on_native_uprising = {
	effect = {
		post_notification = native_uprising_notification
		
		every_country = {
			limit = {
				is_country_type = decentralized
				is_diplomatic_play_enemy_of = root
				NOT = { has_war_with = root }
			}
			save_scope_as = native_nation
		}
		every_diplomatic_play = {
			limit = {
				any_scope_play_involved = {
					this = scope:native_nation
				}
			}
			end_play = yes
		}
		create_diplomatic_play = {
			target_country = scope:native_nation
			war = yes
			type = dp_native_uprising
		}
	}
}

# Root = Country
on_capitulation = {
	effect = {
		if = {
			limit = {
				is_country_type = decentralized
			}
			every_country = {
				limit = {
					has_truce_with = root
				}
				set_tension = { 
					country = root 
					value = 0 
				}
				end_truce = {
					country = root
				}
			}
		}
	}
}

# Root = Character
on_character_creation = {
}

# Root = Character
on_character_death = {
	effect = {
		if = {
			limit = {
				is_ruler = yes
				exists = c:HAW
				owner = c:HAW
				owner = {
					has_law = law_type:law_monarchy
					NOT = { has_variable = death_of_kamehameha }
					NOT = { has_global_variable = gp_hawaii_interest }
				}
			}
			owner = {
				trigger_event = hawaii_events.1
			}
		}
		
		if = {
			limit = {
				has_variable = expedition_leader_var
			}
			owner = {
				trigger_event = expedition_events.110
			}
		}

		##Vice President, if exists, replaces dead President in Presidential Republics
		#if = {
		#	limit = {
		#		is_ruler = yes
		#		owner = {
		#			has_law = law_type:law_presidential_republic
		#			has_variable = vice_president
		#		}
		#	}
		#	owner = {
		#		remove_variable = vice_president
		#		every_scope_character = {
		#			limit = { has_variable = vice_president_trigger }
		#			remove_variable = vice_president_trigger
		#			save_scope_as = former_vice_president
		#		}
		#		create_character = {
		#			first_name = scope:former_vice_president
		#			last_name = scope:former_vice_president
		#			ruler = yes
		#			culture = scope:former_vice_president
		#			religion = scope:former_vice_president
		#			interest_group = scope:former_vice_president
		#			ideology = scope:former_vice_president
		#			birth_date = scope:former_vice_president
		#			traits = scope:former_vice_president
		#			on_created = {
		#				set_variable = vice_president_trigger
		#				owner = {
		#					set_variable = {
		#						name = vice_president
		#						value = PREV
		#					}
		#				}
		#			}
		#		}
		#		create_character = {
		#			on_created = {
		#				set_variable = vice_president_trigger
		#				owner = {
		#					set_variable = {
		#						name = vice_president
		#						value = PREV
		#					}
		#				}
		#			}
		#		}
		#	}
		#}

		if = {
			limit = {
				is_ruler = yes
				exists = c:FRA
				owner = c:FRA
				owner = {
					has_law = law_type:law_monarchy
					has_variable = napoleon3_on_death
				}
			}
			owner = {
				remove_variable = napoleon3
				remove_variable = napoleon3_elected
				trigger_event = france_event.22
			}
		}

		#Succession to the Crown Act 1707, Parliament dissolved on Monarch death
		if = {
			limit = {
				is_ruler = yes
				exists = c:GBR
				owner = c:GBR
				owner = {
					has_law = law_type:law_monarchy
					country_has_voting_franchise = yes
				}
			}
			owner = {
				call_election = {
					months = 1
				}
			}
		}
	}
}

# Root = Releasing Country
# scope:target = Released Country
on_country_released_as_independent = {
	effect = {
		if = {
			limit = {
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				country_rank >= rank_value:great_power
				scope:target = {
					is_country_type = unrecognized
				}
			}
			scope:target = {
				set_country_type = recognized
			}
		}
		if = {
			limit = {
				scope:target = {
					country_has_primary_culture = cu:ashkenazi
				}
				NOT = {
					s:STATE_PALESTINE = {
						is_homeland = cu:ashkenazi
					}
				}
			}
			s:STATE_PALESTINE = {
				add_homeland = sephardic
				add_homeland = ashkenazi
			}
		}
		scope:target = {
			if = {
				limit = {
					country_has_state_religion = rel:theravada
				}
				ig:ig_devout = {
					set_interest_group_name = ig_theravada_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:orthodox
					OR = {
						NOT = { exists = c:RUS }
						NOT = { c:RUS = scope:target }
					}
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_orthodox_patriarch
				}
			}
			if = {
				limit = {
					exists = c:RUS
					c:RUS = scope:target
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_russian_patriarch
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:hindu
				}
				ig:ig_devout = {
					set_interest_group_name = ig_hindu_priesthood
					remove_ideology = ideology_hindu_moralist
					add_ideology = ideology_hindu_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:mahayana
				}
				ig:ig_devout = {
					set_interest_group_name = ig_vajrayana_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:sikh
				}
				ig:ig_devout = {
					set_interest_group_name = ig_sikh_priesthood
					remove_ideology = ideology_moralist
					add_ideology = ideology_sikh_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:oriental_orthodox
				}
				ig:ig_devout = {
					set_interest_group_name = ig_oriental_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_oriental_orthodox_patriarch
				}
			}
		}
	}
}

# Root = Releasing Country
# scope:target = Released Country
on_country_released_as_own_subject = {
	effect = {
		if = {
			limit = {
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				country_rank >= rank_value:great_power
				scope:target = {
					is_country_type = unrecognized
				}
			}
			scope:target = {
				set_country_type = recognized
			}
		}
		if = {
			limit = {
				scope:target = {
					country_has_primary_culture = cu:ashkenazi
				}
				NOT = {
					s:STATE_PALESTINE = {
						is_homeland = cu:ashkenazi
					}
				}
			}
			s:STATE_PALESTINE = {
				add_homeland = sephardic
				add_homeland = ashkenazi
			}
		}
		scope:target = {
			if = {
				limit = {
					country_has_state_religion = rel:theravada
				}
				ig:ig_devout = {
					set_interest_group_name = ig_theravada_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					exists = c:RUS
					c:RUS = scope:target
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_russian_patriarch
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:orthodox
					OR = {
						NOT = { exists = c:RUS }
						NOT = { c:RUS = scope:target }
					}
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_orthodox_patriarch
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:hindu
				}
				ig:ig_devout = {
					set_interest_group_name = ig_hindu_priesthood
					remove_ideology = ideology_hindu_moralist
					add_ideology = ideology_hindu_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:vajrayana
				}
				ig:ig_devout = {
					set_interest_group_name = ig_vajrayana_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:sikh
				}
				ig:ig_devout = {
					set_interest_group_name = ig_sikh_priesthood
					remove_ideology = ideology_moralist
					add_ideology = ideology_sikh_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:oriental_orthodox
				}
				ig:ig_devout = {
					set_interest_group_name = ig_oriental_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_oriental_orthodox_patriarch
				}
			}
		}
	}
}

# Root = Releasing Country
# scope:target = Released Country
on_country_released_as_overlord_subject = {
	effect = {
		if = {
			limit = {
				OR = {
					is_country_type = recognized
					is_country_type = colonial
				}
				country_rank >= rank_value:great_power
				scope:target = {
					is_country_type = unrecognized
				}
			}
			scope:target = {
				set_country_type = recognized
			}
		}
		if = {
			limit = {
				scope:target = {
					country_has_primary_culture = cu:ashkenazi
				}
				NOT = {
					s:STATE_PALESTINE = {
						is_homeland = cu:ashkenazi
					}
				}
			}
			s:STATE_PALESTINE = {
				add_homeland = sephardic
				add_homeland = ashkenazi
			}
		}
		scope:target = {
			if = {
				limit = {
					country_has_state_religion = rel:theravada
				}
				ig:ig_devout = {
					set_interest_group_name = ig_theravada_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:orthodox
					OR = {
						NOT = { exists = c:RUS }
						NOT = { c:RUS = scope:target }
					}
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_orthodox_patriarch
				}
			}
			if = {
				limit = {
					exists = c:RUS
					c:RUS = scope:target
				}
				ig:ig_devout = {
					set_interest_group_name = ig_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_russian_patriarch
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:hindu
				}
				ig:ig_devout = {
					set_interest_group_name = ig_hindu_priesthood
					remove_ideology = ideology_hindu_moralist
					add_ideology = ideology_hindu_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:vajrayana
				}
				ig:ig_devout = {
					set_interest_group_name = ig_vajrayana_monks
					remove_ideology = ideology_moralist
					add_ideology = ideology_buddhist_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:sikh
				}
				ig:ig_devout = {
					set_interest_group_name = ig_sikh_priesthood
					remove_ideology = ideology_moralist
					add_ideology = ideology_sikh_moralist
				}
			}
			if = {
				limit = {
					country_has_state_religion = rel:oriental_orthodox
				}
				ig:ig_devout = {
					set_interest_group_name = ig_oriental_orthodox_church
					remove_ideology = ideology_patriarchal
					add_ideology = ideology_oriental_orthodox_patriarch
				}
			}
		}
	}
}

#BROKEN, USE BELOW ELECTION ON ACTIONS
# Root = Country
on_election_campaign_start = {
	effect = {
		debug_log = "Election Campaign Started"
	}
}

#BROKEN, USE BELOW ELECTION ON ACTIONS
# Root = Country
on_election_campaign_end = {
	effect = {
		debug_log = "Election Campaign Ended"
	}
}

on_election_started = {
	trigger = { in_election_campaign = yes }
	effect = { 
		set_variable = election_onging
	}
}

on_election_ended = {
	trigger = {
		in_election_campaign = no
		has_variable = election_onging
	}
	effect = {
		remove_variable = election_onging
		
		#Septennial Act 1715, 7 year maximum unless Parliament dissolved or Monarch dies
		if = {
			limit = {
				exists = c:GBR
				this = c:GBR
				c:GBR = {
					has_law = law_type:law_monarchy
					country_has_voting_franchise = yes
				}
			}
			call_election = {
				months = 84
			}
		}
	}
}


# Root = owner Country of the Law
# executed when enactment of any law begins
on_law_enactment_started = {
	effect = {
		if = {
			limit = {
				has_law = law_type:law_monarchy
				OR = {
					is_enacting_law = law_type:law_presidential_republic
					is_enacting_law = law_type:law_parliamentary_republic
					is_enacting_law = law_type:law_council_republic
				}
			}
			set_variable = {
				name = abolishing_monarchy_var
				value = 0
			}
			add_journal_entry = { type =  je_abolish_monarchy }
		}
	}
}

# Root = owner Country of the Law
# executed when the end of a checkpoint is reached and the result is success
# (currently, this means the law will get enacted so it will be followed by
# on_law_enactment_ended and on_law_enacted).
#
# NOTE: at the point in time when this on-action is triggered, the law
# is still considered being enacted, therefore the `currently_enacting_law` link
# will work as expected, even though the enactment is about to end
on_law_checkpoint_success = {
	effect = {

	}
}

# Root = owner Country of the Law
# executed when the end of a checkpoint is reached and the result is advance
on_law_checkpoint_advance = {
	random_events = {
		10 = laws.1
		10 = children_rights_events.1 
		10 = free_speech_laws.1
		10 = free_speech_laws.2
		10 = labor_rights.1
		10 = labor_rights.4
		10 = children_rights_events.4
		10 = welfare_laws.1
		10 = welfare_laws.4
		10 = welfare_laws.8
		10 = migration_laws.1
		10 = migration_laws.4
		10 = bureaucracy.2
		10 = colonization.1
		10 = colonization.3
		10 = rights_of_women_laws.1
		10 = rights_of_women_laws.2
		10 = internal_security_events.2
		10 = slavery_law_events.1
		10 = slavery_law_events.4
		10 = laws_police.1
		10 = anarchy.3
		10 = tax.2
		10 = tax.5
		10 = theocracy.1
		10 = citizenship_laws.1
		10 = citizenship_laws.4
		100 = 1848.1
		100 = 1848.3
		10 = education_laws.1
		10 = education_laws.4
		10 = distribution_of_power_laws.1
		10 = council_republic_law_events.1
		10 = distribution_of_power_laws.4
		10 = monarchy_law_events.1
		10 = monarchy_law_events.2
		10 = economy_laws.1
		10 = economy_laws.4
		10 = meiji.4
		10 = meiji.5
		10 = meiji.6
		10 = conscription_laws.1
		10 = republic_laws.1
		10 = internal_security_events.4
		10 = healthcare_laws.1
		10 = healthcare_laws.4
		10 = anti_state_religion.1
		10 = distribution_of_power_laws.7
		10 = distribution_of_power_laws.10
		10 = rights_of_women_laws.5
		2 = generic_laws.1
		2 = generic_laws.4
		2 = generic_laws.7
		2 = generic_laws.10
		2 = ig_petitions.4 #Devout want State Religion
		2 = ig_petitions.7 #Intelligentsia want free speech
		2 = ig_petitions.19 #Armed forces want conscription
		2 = ig_petitions.22 #Petite-Bourgeoisie want Restricted Citizenship
		1 = law_notification.1
	}
	effect = {

	}
}

# Root = owner Country of the Law
# executed when the end of a checkpoint is reached and the result is debate
on_law_checkpoint_debate = {
	random_events = {
		10 = children_rights_events.2
		10 = free_speech_laws.5
		10 = labor_rights.2
		10 = labor_rights.5
		10 = children_rights_events.6
		10 = welfare_laws.2
		10 = welfare_laws.5
		10 = welfare_laws.9
		10 = migration_laws.2
		10 = migration_laws.5
		10 = bureaucracy.3
		10 = colonization.1
		10 = free_speech_laws.5
		10 = free_speech_laws.6
		10 = internal_security_events.3
		10 = slavery_law_events.2
		10 = slavery_law_events.5
		10 = laws_police.2
		10 = anarchy.2
		10 = tax.3
		10 = tax.6
		10 = theocracy.2
		10 = citizenship_laws.2
		10 = citizenship_laws.5
		10 = education_laws.2
		10 = education_laws.5
		100 = 1848.1
		100 = 1848.3
		10 = distribution_of_power_laws.2
		10 = council_republic_law_events.2
		10 = distribution_of_power_laws.5
		10 = monarchy_law_events.3
		10 = economy_laws.2
		10 = economy_laws.5
		10 = isolation.2
		10 = conscription_laws.2
		10 = republic_laws.2
		10 = internal_security_events.5
		10 = healthcare_laws.2
		10 = healthcare_laws.5
		10 = anti_state_religion.2
		10 = colonization.4
		10 = distribution_of_power_laws.8
		10 = distribution_of_power_laws.11
		10 = rights_of_women_laws.4
		10 = law_events.1
		2 = generic_laws.3
		2 = generic_laws.6
		2 = generic_laws.9
		2 = generic_laws.12
		10 = ig_petitions.1 #Landowners want to reverse Suffrage
		10 = ig_petitions.10 #Rural folk want no conscription
		10 = ig_petitions.13 #Trade Unions want compulsory primary school
		20 = ig_petitions.16 #Industrialists want no graduated taxes
		1 = law_notification.2
	}
	effect = {
	}
	events = {
		tanzimat_events.1
		tanzimat_events.2
		tanzimat_events.4
	}
}

# Root = owner Country of the Law
# executed when the end of a checkpoint is reached and the result is stall
#
# NOTE: at the point in time when this on-action is triggered, the law
# is still considered being enacted, therefore the `currently_enacting_law` link
# will work as expected, even if the resulting event is particularly bad and
# will proceed to stop the enactment
on_law_checkpoint_stall = {
	random_events = {
		10 = children_rights_events.3
		10 = free_speech_laws.3
		10 = free_speech_laws.4
		10 = labor_rights.3
		10 = labor_rights.6
		10 = children_rights_events.5
		10 = welfare_laws.3
		10 = welfare_laws.6
		10 = welfare_laws.10
		10 = migration_laws.3
		10 = migration_laws.6
		10 = bureaucracy.1
		10 = colonization.1
		10 = colonization.2
		10 = rights_of_women_laws.3
		10 = internal_security_events.1
		10 = slavery_law_events.3
		10 = slavery_law_events.6
		10 = laws_police.3
		10 = anarchy.1
		10 = tax.1
		10 = tax.4
		10 = theocracy.3
		10 = citizenship_laws.3
		10 = citizenship_laws.6
		10 = education_laws.3
		10 = education_laws.6
		100 = 1848.1
		100 = 1848.3
		10 = distribution_of_power_laws.3
		10 = council_republic_law_events.3
		10 = distribution_of_power_laws.6
		10 = monarchy_law_events.4
		10 = economy_laws.3
		10 = economy_laws.6
		10 = isolation.1
		10 = conscription_laws.3
		10 = republic_laws.3
		10 = internal_security_events.6
		10 = healthcare_laws.3
		10 = healthcare_laws.6
		10 = anti_state_religion.3
		10 = distribution_of_power_laws.9
		10 = distribution_of_power_laws.12
		10 = rights_of_women_laws.6
		2 = generic_laws.2
		2 = generic_laws.5
		2 = generic_laws.8
		2 = generic_laws.11
		1 = law_notification.3
	}
	effect = {
	}
}

# Root = owner Country of the Law
# executed when enactment stops for any reason. Could be because the law has
# been enacted, or because the enactment has been stopped by the player.
#
# NOTE: at the point in time when this on-action is triggered, the law
# is still considered being enacted, therefore the `currently_enacting_law` link
# will work as expected, even though the enactment is _just_ about to end
on_law_enactment_ended = {
	effect = {
	}
}

# Root owner Country of the Law
# executed when the law is activated for any reason. It's usually because it
# has been enacted, but script can activate laws directly without going through
# the enactment process. Normally, it's immediately preceded by
# on_law_enactment_ended, but if a law is directly set by script, thus
# bypassing the enactment process, this will execute while
# on_law_enactment_ended will not
#
# NOTE: unlike the other on_law_<something> on-actions, at the point in time
# when this is triggered the law that was enacted is no longer considered being
# enacted. Therefore using the `currently_enacting_law` link will return the
# null law
on_law_activated = {
	events = {
	}
	effect = {
		#if = {
		#	limit = {
		#		has_law = law_type:law_frontier_colonialism
		#	}
		#	every_scope_state = {
		#		limit = {
		#			is_under_colonization = yes
		#			NOT = {
		#				has_modifier = frontier_colonialism_modifier
		#				any_neighbouring_state = {
		#					is_incorporated = yes
		#					owner = scope:colony_founder
		#				}
		#			}
		#		}
		#		add_modifier = frontier_colonialism_modifier
		#	}
		#}
		#if = {
		#	limit = {
		#		NOT = { has_law = law_type:law_frontier_colonialism }
		#	}
		#	every_scope_state = {
		#		limit = {
		#			is_under_colonization = yes
		#			has_modifier = frontier_colonialism_modifier
		#		}
		#		remove_modifier = frontier_colonialism_modifier
		#	}
		#}
		#if = {
		#	limit = {
		#		AND = {
		#			has_law = law_type:law_monarchy
		#			country_has_voting_franchise = yes
		#		}
		#	}
		#	create_character = {
		#		on_created = {
		#			set_variable = prime_minister_trigger
		#			owner = {
		#				set_variable = {
		#					name = prime_minister
		#					value = PREV
		#				}
		#			}
		#		}
		#	}
		#}

		#if = {
		#	limit = {
		#		AND = {
		#			has_law = law_type:law_monarchy
		#			ROOT = c:USA
		#		}
		#	}
		#	annex = c:MEX
		#}
	}
}